@echo off

set CONFIG=%1
set ENVDIR=%~2
set OUTDIR=%3
set DLL=%4
set OUT=%OUTDIR:pkg\rel\=pkg\lib\%

set DOTFCMD=%ENVDIR%..\..\..\Microsoft Visual Studio 10.0\PreEmptive Solutions\Dotfuscator Community Edition\dotfuscatorCLI.exe

IF NOT EXIST "%DOTFCMD%" (
  echo Dotfuscator CE 5.0.2601 is needed to run instrumentation.
  goto end
)

IF %CONFIG% NEQ Release (
  echo Skipping instrumentation for non-release configuration.
  goto end
)

"%DOTFCMD%" Xomega.Dotfuscator.xml -in:%OUTDIR%%DLL% -out:%OUT%

:end